package cn.ywsj.ywsjmidtier.controller;

import cn.ywsj.ywsjmidtier.entity.VO.SettlementApplyVo;
import cn.ywsj.ywsjmidtier.service.WechatPaymentFeign;
import cn.ywsj.ywsjmidtier.utils.JsonObjectUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "支付")
@RestController
@RequestMapping("/wechat/member/payment")
public class WechatPaymentController {

    @Autowired
    private WechatPaymentFeign paymentFeign;

    /**
     * 购物车_账期支付
     * @param applyVo
     * @param type
     * @return
     */
    @ApiOperation("购物车_账期支付")
    @PostMapping({"/savesettlement"})
    public String saveSettlement(SettlementApplyVo applyVo, Integer type) {
        return paymentFeign.saveSettlement(JsonObjectUtil.ObjectToJson(applyVo),type);
    }
}
